Skip to main content

Button and Group Inspector Attributes

Two new attributes have been added to make the inspector easier to use. Namely the GroupItem and Button attributes.

Using these works exactly the same as any other attributes.

Button

To use the button attribute, simple write [Button] above any function.

using ExtensionsTools;

...

[Button]
void ClickMe() {
Debug.Log("I've been clicked!");
}

And the result in the inspector:

ButtonAttribute

Group

To use the groupitem attribute simple write [GroupItem(groupName)] before an SerializeField

using ExtensionsTools;

...

[GroupItem("PlayerInfo")][SerializeField] float m_Health;
[GroupItem("PlayerInfo")][SerializeField] string m_PlayerName;

[GroupItem("GunInfo")][SerializeField] int m_Bullets;
[GroupItem("GunInfo")][SerializeField] string m_GunName;

And the result in the inspector:

GroupItemAttribute